/**
 * api管理
 */
import request from './../utils/request'
 
export default {
    // 登录
    login(params) {
        return request({
            url: '/admin/index/login',
            method: 'post',
            data: params,
            mock:true
        })
    },
    //获取菜单
    getMenuList(params){
        return request({
            url: '/admin/index/index',
            method: 'get',
            data:{},
            mock:true
        })
    },
    //获取首页控制器信息
    getDashboard(){
        return request ({
            url:'/admin/dashboard/index',
            method:'post', 
            mock:true
        })
    },
    //获取配置内容
    getConfigList(){
        return request({
            url: 'admin/general.Configs/index',
            method: 'post',
            
            mock:true
        })
    },
    //修改配置
    setConfigList(params){
        return request({
            url: 'admin/general.Configs/edit',
            method: 'post',
            data: params,
            mock:true
        })
    },
    //获取个人信息和个人操作日志
    getprofileList(params){
        return request({
            url: '/admin/general.profile/index',
            method: 'post',
            
            data: params,
            mock:true
        })
    },
    //设置个人信息
     setprofileList(params){
        return request({
            url: '/admin/general.profile/update',
            method: 'post',
            data: params,
            mock:true
        })
    },

    //获取数据库信息
    getDatabaseList(params){
        return request({
            url: '/admin/general.Database/index',
            method: 'post',
            data: params,
            mock:true
        })
    },
    //优化表
    optimizeDatabase(params){
        return request({
            url: '/admin/general.Database/optimize',
            method: 'post',
            data: params,
            mock:true
        })
    },
    //修复表
    repairDatabase(params){
        return request({
            url: '/admin/general.Database/repair',
            method: 'post',
            data: params,
            mock:true
        })
    },
    //备份表
    dbbackup(params){
        return request({
            url: '/admin/general.Database/dbbackup',
            method: 'post',
            data: params,
            mock:true
        })
    },
    //获取备份信息
    getbackuplstList(params){
        return request({
            url: '/admin/general.Database/backuplst',
            method: 'post',
            data: params,
            mock:true
        })
    },
    //还原
    restore(params){
        return request({
            url: '/admin/general.Database/restore',
            method: 'post',
            data: params,
            mock:true
        })
    },
    //删除备份文件
    delbackup(params){
        return request({
            url: '/admin/general.Database/delbackup',
            method: 'post',
            data: params,
            mock:true
        })
    },
    admin_log(params){
        return request({
            url: '/admin/auth.admin_log/index',
            method: 'post',
            data: params,
            mock:true
        })
    },
    

/**插件开始 */
///admin/Addon/index 查看本地插件列表
    getLocalAddonList(params){
        return request ({
            url:'admin/Addon/index',
            method:'post',
            data:params,
            mock:true
        })
    },
///离线安装
    getLocalinstallAddon(params){
        return request ({
            url:'admin/Addon/lxinstall',
            method:'post',
            data:params,
            mock:true
        })
    },

///卸载
    getLocaluninstallAddon(params){
        return request ({
            url:'admin/Addon/uninstall',
            method:'post',
            data:params,
            mock:true
        })
    },
/**插件结束 */
/************/
    
    //获取权限节点
    getRule(params={status:"norma"}){
        return request ({
            url:'/admin/auth.rule/index',
            method:'post', 
            data: params,
            mock:true
        })
    },

    //新增权限节点
    addRule(params={status:"norma"}){
        return request ({
            url:'/admin/auth.rule/add',
            method:'post', 
            data: params,
            mock:true
        })
    },

 
    //查看单条数据
    editRuleFind(params){
        return request ({
            url:'/admin/auth.rule/edit',
            method:'get', 
            data: params,
            mock:true
        })
    },
    //修改权限节点
    editRule(params,ids){
        return request ({
            url:'/admin/auth.rule/edit?ids='+ids,
            method:'post', 
            data: params,
            mock:true
        })
    },
    //删除权限节点
    delRule(params){
        return request ({
            url:'/admin/auth.rule/del',
            method:'get', 
            data: params,
            mock:true
        })
    },

/*****菜单结束 */


/******角色管理开始****/
    
    //获取列表
    getGroup(params={status:"norma"}){
        return request ({
            url:'/admin/auth.group/index',
            method:'post', 
            data: params,
            mock:true
        })
    },

    //新增
    addGroup(params={status:"norma"}){
        return request ({
            url:'/admin/auth.group/add',
            method:'post', 
            data: params,
            mock:true
        })
    },

 
    //查看单条数据
    editGroupFind(params){
        return request ({
            url:'/admin/auth.group/edit',
            method:'get', 
            data: params,
            mock:true
        })
    },
    //修改 
    editGroup(params,ids){
        return request ({
            url:'/admin/auth.group/edit?ids='+ids,
            method:'post', 
            data: params,
            mock:true
        })
    },
    //删除 
    delGroup(params){
        return request ({
            url:'/admin/auth.group/del',
            method:'get', 
            data: params,
            mock:true
        })
    },

/*****角色结束 */

/******管理员管理开始****/
    
    //获取列表
    getAdmin(params={status:"norma"}){
        return request ({
            url:'/admin/auth.admin/index',
            method:'post', 
            data: params,
            mock:true
        })
    },

    //新增
    addAdmin(params={status:"norma"}){
        return request ({
            url:'/admin/auth.admin/add',
            method:'post', 
            data: params,
            mock:true
        })
    },

 
    //查看单条数据
    editAdminFind(params){
        return request ({
            url:'/admin/auth.admin/edit',
            method:'get', 
            data: params,
            mock:true
        })
    },
    //修改 
    editAdmin(params,ids){
        return request ({
            url:'/admin/auth.admin/edit?ids='+ids,
            method:'post', 
            data: params,
            mock:true
        })
    },
    //删除 
    delAdmin(params){
        return request ({
            url:'/admin/auth.admin/del',
            method:'get', 
            data: params,
            mock:true
        })
    },

/*****管理员结束 */


    noticeCount(params) {
        return request({
            url: '/leave/count',
            method: 'get',
            data:{},
            mock:true
        })
    },
    
    getMenuListData(params = { menuState: 1 }){
        return request({
            url: '/users/getPermissionList',
            method: 'get',
            data:params,
            mock:true
        })
    },
    getUserList(params) {
        return request({
            url: '/users/list',
            method: 'get',
            data: params,
            mock:true
        })
    },
    getUserAllList(params) {
        return request({
            url: '/users/all/list',
            method: 'get',
            data: params,
            mock:true
        })
    },
    userDel(params){
        return request({
            url: '/users/delete',
            method: 'post',
            data: params,
            mock:true
        })
    },
    getRoleAllList(){
        return request({
            url:'/roles/allList',
            method:'get',
            data:{},
            mock:true
        })
    },
    getRoleList(){
        return request({
            url:'/roles/List',
            method:'get',
            data:{},
            mock:true
        })
    },
    getDeptList(){
        return request({
            url:'/dept/list',
            method:'get',
            data:{},
            mock:true
        })
    },
    userSubmit(params){
        return request({
            url:'/users/operate',
            method:'post',
            data:params,
            mock:true
        })
    },
    menuSubmit(params) {
        return request({
            url: '/menu/operate',
            method: 'post',
            data: params,
            mock: true
        })
    },
    updatePermission(params) {
        return request({
            url: '/roles/update/permission',
            method: 'post',
            data: params,
            mock: true
        })
    }
}